package cn.wolfcode.luowowo.repository;

import cn.wolfcode.luowowo.search.template.StrategyTemplate;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StrategyTemplateRepository extends ElasticsearchRepository<StrategyTemplate,Long> {

    /**
     * 根据省份id做查询
     * @param provinceId
     * @param pageable
     * @return
     */
    Page<StrategyTemplate> findByProvinceId(Long provinceId, Pageable pageable);

    /**
     * 根据国家id做查询
     * @param countryId
     * @param pageable
     * @return
     */
    Page<StrategyTemplate> findByCountryId(Long countryId, Pageable pageable);

    /**
     * 根据主题id做查询
     * @param themeId
     * @param pageable
     * @return
     */
    Page<StrategyTemplate> findByThemeId(Long themeId, Pageable pageable);

    List<StrategyTemplate> findByDestName(String keyword);
}
